package com.xy;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 谢阳
 * @version 1.8.0_131
 * @date 2022/6/12 16:34
 * @description
 */
public class University extends OrganizationComponent {
    List<OrganizationComponent> colleges = new ArrayList<>();

    public University(String name, String des) {
        super(name, des);
    }

    @Override
    protected void add(OrganizationComponent o) {
        colleges.add(o);
    }

    @Override
    protected void remove(OrganizationComponent o) {
        colleges.remove(o);
    }

    @Override
    protected void print() {
        System.out.println("-----------" + getName() + "-----------");
        colleges.forEach(OrganizationComponent::print);
    }
}
